<template>
  <div>
      <div class="shop">
        <div class="top">
          <h3>购物车</h3>
          <p>配送至:南二环1956号西50米...</p>
          <p>
            <span>编辑</span>
            <span>···</span>
          </p>
        </div>
        <div class="title">
          <p>全部</p>
          <p>降价</p>
          <p>筛选</p>
        </div>
    <div v-for="item in arr" :key="item.id">
        <Shop :item="item" /></div>
        <div class="bom">
          <li>
            <p><input type="checkbox" :checked="arr.every(item=>item.status)" name="" value="" @change="checkAll($event.target.checked)" />全选</p>
            <p>
              <span>合计￥{{shopPinia.total}}</span>
              <span>优惠减￥6,优惠明细</span>
            </p>
          </li>
          <p class="lj">领券结算(0)</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import Shoplist from "./shoplist.js";
import Shop from "../components/Shop.vue";
import "../components/Shop.css";
let shopPinia = Shoplist();
const arr = shopPinia.$state.arr;
console.log(shopPinia);
function checkAll(done){
  shopPinia.changeAll(done)
}
</script>

<style lang="scss" scoped></style>
